import httpClient from '../util/request';


export const getSettingApi = (data) => {
    return httpClient.request({baseURL: `http://${import.meta.env.VITE_API_URL}`, url: '/setting/list', method: 'post', data});
}

export const settingEditApi = (data) => {
    return httpClient.request({baseURL: `http://${import.meta.env.VITE_API_URL}`, url: '/setting/edit', method: 'post', data});
}


/* VPN 相关 */
export const listVpnApi = (params) => {
    return httpClient.request({baseURL: `http://${window.APP_CONFIG.server_url}`, url: '/vpn/list', method: 'get', params});
}

// 启动本机客户端
export const startVpnApi = (data) => {
    return httpClient.request({baseURL: `http://${import.meta.env.VITE_API_URL}`, url: '/vpn/start-vpn', method: 'post', data});
}

// 关闭本机客户端共享
export const stopVpnApi = (data) => {
    return httpClient.request({baseURL: `http://${import.meta.env.VITE_API_URL}`, url: '/vpn/stop-vpn', method: 'post', data});
}


/* webrtc 相关 */
export const webrtcUsersApi = (params) => {
    return httpClient.request({baseURL: `http://${window.APP_CONFIG.server_url}`, url: '/webrtc/users', method: 'get', params: params});
}
